import React, { SFC } from 'react';

import { Redirect, Route, Switch, useHistory, useLocation } from 'react-router-dom';

import TabBarNav from '../components/TabBarNav/TabBarNav';
import UserRadio from './User/Radio';
import { ROUTE_URL_MAP } from '../constants/route-url';

const Home: SFC = () => {
    return (
        <div className="page page--nav">
            <TabBarNav isFixed />
            <Switch>
                <Route
                    exact
                    path={ROUTE_URL_MAP.home}
                    render={(): JSX.Element => <Redirect to={ROUTE_URL_MAP.home + '/user'} />}
                />
                <Route path={ROUTE_URL_MAP.home + '/user'}>
                    <UserRadio />
                </Route>
            </Switch>
        </div>
    );
};
export default Home;
